/*      */ package dm.jdbc.rowset;
/*      */ 
/*      */ import dm.jdbc.dbaccess.Const;
/*      */ import dm.jdbc.dbaccess.DBError;
/*      */ import dm.jdbc.driver.DmDriver_bs;
/*      */ import dm.jdbc.driver.DmdbConnection;
/*      */ import dm.jdbc.driver.DmdbConnection_bs;
/*      */ import dm.jdbc.driver.DmdbResultSet;
/*      */ import dm.jdbc.driver.DmdbResultSetMetaData;
/*      */ import dm.jdbc.driver.DmdbResultSetMetaData_bs;
/*      */ import dm.jdbc.driver.DmdbRowId;
/*      */ import dm.jdbc.pool.DmdbDataSource;
/*      */ import java.io.InputStream;
/*      */ import java.io.Reader;
/*      */ import java.math.BigDecimal;
/*      */ import java.net.URL;
/*      */ import java.sql.Blob;
/*      */ import java.sql.Clob;
/*      */ import java.sql.Connection;
/*      */ import java.sql.Date;
/*      */ import java.sql.NClob;
/*      */ import java.sql.ResultSet;
/*      */ import java.sql.ResultSetMetaData;
/*      */ import java.sql.RowId;
/*      */ import java.sql.SQLException;
/*      */ import java.sql.SQLXML;
/*      */ import java.sql.Statement;
/*      */ import java.sql.Time;
/*      */ import java.sql.Timestamp;
/*      */ import java.util.Calendar;
/*      */ import java.util.Properties;
/*      */ import java.util.ResourceBundle;
/*      */ import java.util.Vector;
/*      */ import javax.naming.InitialContext;
/*      */ import javax.naming.NamingException;
/*      */ import javax.sql.RowSet;
/*      */ import javax.sql.RowSetEvent;
/*      */ import javax.sql.RowSetInternal;
/*      */ import javax.sql.RowSetMetaData;
/*      */ import javax.sql.rowset.CachedRowSet;
/*      */ import javax.sql.rowset.spi.SyncProviderException;
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ public class DmdbCachedRowSet
/*      */   extends DmdbCachedRowSet_bs
/*      */   implements CachedRowSet, RowSetInternal
/*      */ {
/*   53 */   private DmdbConnection m_conn = null;
/*   54 */   private DmdbResultSet m_resultSet = null;
/*   55 */   private static transient DmDriver_bs m_driver = null;
/*      */   
/*      */   public DmdbCachedRowSet() throws SQLException
/*      */   {}
/*      */   
/*      */   DmdbConnection_bs getConnectionInner() throws SQLException
/*      */   {
/*   62 */     DmdbConnection conn = this.m_conn;
/*   63 */     if ((conn != null) && (!conn.isClosed())) {
/*   64 */       return conn.getRealConn();
/*      */     }
/*      */     
/*   67 */     String dataSourceName = getDataSourceName();
/*   68 */     if (dataSourceName != null) {
/*      */       try {
/*   70 */         InitialContext initialcontext = new InitialContext();
/*   71 */         DmdbDataSource datasource = (DmdbDataSource)initialcontext
/*   72 */           .lookup(dataSourceName);
/*   73 */         conn = (DmdbConnection)datasource.getConnection();
/*      */       } catch (NamingException namingexception) {
/*   75 */         throw new SQLException(
/*   76 */           "Unable to connect through the DataSource\n" + 
/*   77 */           namingexception.getMessage());
/*      */       }
/*      */     }
/*      */     else {
/*   81 */       if (m_driver == null) {
/*   82 */         m_driver = new DmDriver_bs();
/*      */       }
/*   84 */       String url = getUrl();
/*   85 */       String usr = getUsername();
/*   86 */       String psw = getPassword();
/*      */       
/*   88 */       Properties props = m_driver.parseURL(url, null);
/*   89 */       if (!props.containsKey("user"))
/*   90 */         props.put("user", usr);
/*   91 */       if (!props.containsKey("password")) {
/*   92 */         props.put("password", psw);
/*      */       }
/*   94 */       conn = new DmdbConnection((DmdbConnection_bs)m_driver.connect(url, 
/*   95 */         props));
/*      */     }
/*      */     
/*   98 */     conn.setTransactionIsolation(getTransactionIsolation());
/*   99 */     conn.setTypeMap(getTypeMap());
/*      */     
/*  101 */     this.m_closed = false;
/*  102 */     this.m_conn = conn;
/*  103 */     return conn.getRealConn();
/*      */   }
/*      */   
/*      */   private void checkConnSpecified(Connection conn) throws SQLException {
/*  107 */     if ((conn == null) || (conn.isClosed())) {
/*  108 */       throw new SQLException(
/*  109 */         Const.res.getString("error.cachedROwSetSpecConnInvalid"));
/*      */     }
/*      */   }
/*      */   
/*      */   public void setNull(String parameterName, int sqlType) throws SQLException {
/*  114 */     setObjectInner(parameterName, null, sqlType, false);
/*      */   }
/*      */   
/*      */   public void setNull(String parameterName, int sqlType, String typeName)
/*      */     throws SQLException
/*      */   {
/*  120 */     setObjectInner(parameterName, null, sqlType, typeName);
/*      */   }
/*      */   
/*      */   public void setBoolean(String parameterName, boolean x) throws SQLException
/*      */   {
/*  125 */     setObjectInner(parameterName, Boolean.valueOf(x));
/*      */   }
/*      */   
/*      */   public void setByte(String parameterName, byte x) throws SQLException
/*      */   {
/*  130 */     setObjectInner(parameterName, Byte.valueOf(x));
/*      */   }
/*      */   
/*      */   public void setShort(String parameterName, short x) throws SQLException
/*      */   {
/*  135 */     setObjectInner(parameterName, Short.valueOf(x));
/*      */   }
/*      */   
/*      */   public void setInt(String parameterName, int x) throws SQLException
/*      */   {
/*  140 */     setObjectInner(parameterName, Integer.valueOf(x));
/*      */   }
/*      */   
/*      */   public void setLong(String parameterName, long x) throws SQLException
/*      */   {
/*  145 */     setObjectInner(parameterName, Long.valueOf(x));
/*      */   }
/*      */   
/*      */   public void setFloat(String parameterName, float x) throws SQLException
/*      */   {
/*  150 */     setObjectInner(parameterName, Float.valueOf(x));
/*      */   }
/*      */   
/*      */   public void setDouble(String parameterName, double x) throws SQLException
/*      */   {
/*  155 */     setObjectInner(parameterName, Double.valueOf(x));
/*      */   }
/*      */   
/*      */   public void setBigDecimal(String parameterName, BigDecimal x)
/*      */     throws SQLException
/*      */   {
/*  161 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setString(String parameterName, String x) throws SQLException
/*      */   {
/*  166 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setBytes(String parameterName, byte[] x) throws SQLException
/*      */   {
/*  171 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setTimestamp(String parameterName, Timestamp x)
/*      */     throws SQLException
/*      */   {
/*  177 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setAsciiStream(String parameterName, InputStream x, int length)
/*      */     throws SQLException
/*      */   {
/*  183 */     setObjectInner(parameterName, x, length, false);
/*      */   }
/*      */   
/*      */   public void setBinaryStream(String parameterName, InputStream x, int length)
/*      */     throws SQLException
/*      */   {
/*  189 */     setObjectInner(parameterName, x, length, false);
/*      */   }
/*      */   
/*      */   public void setCharacterStream(String parameterName, Reader reader, int length)
/*      */     throws SQLException
/*      */   {
/*  195 */     setObjectInner(parameterName, reader, length, false);
/*      */   }
/*      */   
/*      */   public void setAsciiStream(int parameterIndex, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  201 */     setObjectInner(Integer.valueOf(parameterIndex), x);
/*      */   }
/*      */   
/*      */   public void setAsciiStream(String parameterName, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  207 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setBinaryStream(int parameterIndex, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  213 */     setObjectInner(Integer.valueOf(parameterIndex), x);
/*      */   }
/*      */   
/*      */   public void setBinaryStream(String parameterName, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  219 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setCharacterStream(int parameterIndex, Reader reader)
/*      */     throws SQLException
/*      */   {
/*  225 */     setObjectInner(Integer.valueOf(parameterIndex), reader);
/*      */   }
/*      */   
/*      */   public void setCharacterStream(String parameterName, Reader reader)
/*      */     throws SQLException
/*      */   {
/*  231 */     setObjectInner(parameterName, reader);
/*      */   }
/*      */   
/*      */ 
/*      */   public void setNCharacterStream(int parameterIndex, Reader value)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setObject(int parameterIndex, Object x, int targetSqlType, int scale)
/*      */     throws SQLException
/*      */   {
/*  243 */     setObjectInner(Integer.valueOf(parameterIndex), x, targetSqlType, scale);
/*      */   }
/*      */   
/*      */   public void setObject(int parameterIndex, Object x, int targetSqlType)
/*      */     throws SQLException
/*      */   {
/*  249 */     setObjectInner(Integer.valueOf(parameterIndex), x, targetSqlType, true);
/*      */   }
/*      */   
/*      */   public void setObject(int parameterIndex, Object x) throws SQLException
/*      */   {
/*  254 */     setObjectInner(Integer.valueOf(parameterIndex), x);
/*      */   }
/*      */   
/*      */   public void setObject(String parameterName, Object x, int targetSqlType, int scale)
/*      */     throws SQLException
/*      */   {
/*  260 */     setObjectInner(parameterName, x, targetSqlType, scale);
/*      */   }
/*      */   
/*      */   public void setObject(String parameterName, Object x, int targetSqlType)
/*      */     throws SQLException
/*      */   {
/*  266 */     setObjectInner(parameterName, x, targetSqlType, true);
/*      */   }
/*      */   
/*      */   public void setObject(String parameterName, Object x) throws SQLException
/*      */   {
/*  271 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setBlob(int parameterIndex, InputStream inputStream, long length)
/*      */     throws SQLException
/*      */   {
/*  277 */     setObjectInner(Integer.valueOf(parameterIndex), inputStream, length);
/*      */   }
/*      */   
/*      */   public void setBlob(int parameterIndex, InputStream inputStream)
/*      */     throws SQLException
/*      */   {
/*  283 */     setObjectInner(Integer.valueOf(parameterIndex), inputStream);
/*      */   }
/*      */   
/*      */   public void setBlob(String parameterName, InputStream inputStream, long length)
/*      */     throws SQLException
/*      */   {
/*  289 */     setObjectInner(parameterName, inputStream, length);
/*      */   }
/*      */   
/*      */   public void setBlob(String parameterName, Blob x) throws SQLException
/*      */   {
/*  294 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setBlob(String parameterName, InputStream inputStream)
/*      */     throws SQLException
/*      */   {
/*  300 */     setObjectInner(parameterName, inputStream);
/*      */   }
/*      */   
/*      */   public void setClob(int parameterIndex, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  306 */     setObjectInner(Integer.valueOf(parameterIndex), reader, length);
/*      */   }
/*      */   
/*      */   public void setClob(int parameterIndex, Reader reader) throws SQLException
/*      */   {
/*  311 */     setObjectInner(Integer.valueOf(parameterIndex), reader);
/*      */   }
/*      */   
/*      */   public void setClob(String parameterName, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  317 */     setObjectInner(parameterName, reader, length);
/*      */   }
/*      */   
/*      */   public void setClob(String parameterName, Clob x) throws SQLException
/*      */   {
/*  322 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setClob(String parameterName, Reader reader)
/*      */     throws SQLException
/*      */   {
/*  328 */     setObjectInner(parameterName, reader);
/*      */   }
/*      */   
/*      */   public void setDate(String parameterName, Date x) throws SQLException
/*      */   {
/*  333 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setDate(String parameterName, Date x, Calendar cal)
/*      */     throws SQLException
/*      */   {
/*  339 */     setObjectInner(parameterName, x, cal);
/*      */   }
/*      */   
/*      */   public void setTime(String parameterName, Time x) throws SQLException
/*      */   {
/*  344 */     setObjectInner(parameterName, x);
/*      */   }
/*      */   
/*      */   public void setTime(String parameterName, Time x, Calendar cal)
/*      */     throws SQLException
/*      */   {
/*  350 */     setObjectInner(parameterName, x, cal);
/*      */   }
/*      */   
/*      */   public void setTimestamp(String parameterName, Timestamp x, Calendar cal)
/*      */     throws SQLException
/*      */   {
/*  356 */     setObjectInner(parameterName, x, cal);
/*      */   }
/*      */   
/*      */ 
/*      */   public void setSQLXML(int parameterIndex, SQLXML xmlObject)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setSQLXML(String parameterName, SQLXML xmlObject)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setRowId(int parameterIndex, RowId x)
/*      */     throws SQLException
/*      */   {
/*  373 */     if (x == null) {
/*  374 */       setNull(parameterIndex, -8);
/*      */     } else {
/*  376 */       long val = ((DmdbRowId)x).getValue();
/*  377 */       setLong(parameterIndex, val);
/*      */     }
/*      */   }
/*      */   
/*      */   public void setRowId(String parameterName, RowId x) throws SQLException
/*      */   {
/*  383 */     if (x == null) {
/*  384 */       setNull(parameterName, -8);
/*      */     } else {
/*  386 */       long val = ((DmdbRowId)x).getValue();
/*  387 */       setLong(parameterName, val);
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public void setNString(int parameterIndex, String value)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */ 
/*      */   public void setNString(String parameterName, String value)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */ 
/*      */   public void setNCharacterStream(int parameterIndex, Reader value, long length)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */ 
/*      */   public void setNCharacterStream(String parameterName, Reader value, long length)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */ 
/*      */   public void setNCharacterStream(String parameterName, Reader value)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */ 
/*      */   public void setNClob(String parameterName, NClob value)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setNClob(String parameterName, Reader reader, long length)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setNClob(String parameterName, Reader reader)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setNClob(int parameterIndex, Reader reader, long length)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setNClob(int parameterIndex, NClob value)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setNClob(int parameterIndex, Reader reader)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public void setURL(int parameterIndex, URL x)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */ 
/*      */   public RowId getRowId(int columnIndex)
/*      */     throws SQLException
/*      */   {
/*  461 */     long val = getLong(columnIndex);
/*  462 */     String tabName = this.m_rsmd.getTableName(columnIndex);
/*  463 */     String schName = this.m_rsmd.getSchemaName(columnIndex);
/*  464 */     return new DmdbRowId(val, schName, tabName);
/*      */   }
/*      */   
/*      */   public RowId getRowId(String columnLabel) throws SQLException
/*      */   {
/*  469 */     return getRowId(findColumn(columnLabel));
/*      */   }
/*      */   
/*      */ 
/*      */   public void updateRowId(int columnIndex, RowId x)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */   public void updateRowId(String columnLabel, RowId x)
/*      */     throws SQLException
/*      */   {}
/*      */   
/*      */   public int getHoldability()
/*      */     throws SQLException
/*      */   {
/*  484 */     return this.m_resultSet.getHoldability();
/*      */   }
/*      */   
/*      */   public boolean isClosed() throws SQLException
/*      */   {
/*  489 */     return this.m_closed;
/*      */   }
/*      */   
/*      */   public void updateNString(int columnIndex, String nString)
/*      */     throws SQLException
/*      */   {
/*  495 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNString(String columnLabel, String nString)
/*      */     throws SQLException
/*      */   {
/*  501 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNClob(int columnIndex, NClob nClob) throws SQLException
/*      */   {
/*  506 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNClob(String columnLabel, NClob nClob)
/*      */     throws SQLException
/*      */   {
/*  512 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public NClob getNClob(int columnIndex) throws SQLException
/*      */   {
/*  517 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public NClob getNClob(String columnLabel) throws SQLException
/*      */   {
/*  522 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public SQLXML getSQLXML(int columnIndex) throws SQLException
/*      */   {
/*  527 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public SQLXML getSQLXML(String columnLabel) throws SQLException
/*      */   {
/*  532 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateSQLXML(int columnIndex, SQLXML xmlObject)
/*      */     throws SQLException
/*      */   {
/*  538 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateSQLXML(String columnLabel, SQLXML xmlObject)
/*      */     throws SQLException
/*      */   {
/*  544 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public String getNString(int columnIndex) throws SQLException
/*      */   {
/*  549 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public String getNString(String columnLabel) throws SQLException
/*      */   {
/*  554 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public Reader getNCharacterStream(int columnIndex) throws SQLException
/*      */   {
/*  559 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public Reader getNCharacterStream(String columnLabel) throws SQLException
/*      */   {
/*  564 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNCharacterStream(int columnIndex, Reader x, long length)
/*      */     throws SQLException
/*      */   {
/*  570 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNCharacterStream(String columnLabel, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  576 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateAsciiStream(int columnIndex, InputStream x, long length)
/*      */     throws SQLException
/*      */   {
/*  582 */     updateAsciiStream(columnIndex, x);
/*      */   }
/*      */   
/*      */   public void updateBinaryStream(int columnIndex, InputStream x, long length)
/*      */     throws SQLException
/*      */   {
/*  588 */     updateBinaryStream(columnIndex, x);
/*      */   }
/*      */   
/*      */   public void updateCharacterStream(int columnIndex, Reader x, long length)
/*      */     throws SQLException
/*      */   {
/*  594 */     updateCharacterStream(columnIndex, x);
/*      */   }
/*      */   
/*      */   public void updateAsciiStream(String columnLabel, InputStream x, long length)
/*      */     throws SQLException
/*      */   {
/*  600 */     updateAsciiStream(columnLabel, x);
/*      */   }
/*      */   
/*      */   public void updateBinaryStream(String columnLabel, InputStream x, long length)
/*      */     throws SQLException
/*      */   {
/*  606 */     updateBinaryStream(columnLabel, x);
/*      */   }
/*      */   
/*      */   public void updateCharacterStream(String columnLabel, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  612 */     updateCharacterStream(findColumn(columnLabel), reader);
/*      */   }
/*      */   
/*      */   public void updateBlob(int columnIndex, InputStream inputStream, long length)
/*      */     throws SQLException
/*      */   {
/*  618 */     updateBlob(columnIndex, inputStream);
/*      */   }
/*      */   
/*      */   public void updateBlob(String columnLabel, InputStream inputStream, long length)
/*      */     throws SQLException
/*      */   {
/*  624 */     updateBlob(findColumn(columnLabel), inputStream);
/*      */   }
/*      */   
/*      */   public void updateClob(int columnIndex, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  630 */     updateClob(columnIndex, reader);
/*      */   }
/*      */   
/*      */   public void updateClob(String columnLabel, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  636 */     updateClob(columnLabel, reader);
/*      */   }
/*      */   
/*      */   public void updateNClob(int columnIndex, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  642 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNClob(String columnLabel, Reader reader, long length)
/*      */     throws SQLException
/*      */   {
/*  648 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNCharacterStream(int columnIndex, Reader x)
/*      */     throws SQLException
/*      */   {
/*  654 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNCharacterStream(String columnLabel, Reader reader)
/*      */     throws SQLException
/*      */   {
/*  660 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateAsciiStream(int columnIndex, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  666 */     updateObjectInner(columnIndex, x);
/*      */   }
/*      */   
/*      */   public void updateBinaryStream(int columnIndex, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  672 */     updateObjectInner(columnIndex, x);
/*      */   }
/*      */   
/*      */   public void updateCharacterStream(int columnIndex, Reader x)
/*      */     throws SQLException
/*      */   {
/*  678 */     updateObjectInner(columnIndex, x);
/*      */   }
/*      */   
/*      */   public void updateAsciiStream(String columnLabel, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  684 */     updateAsciiStream(findColumn(columnLabel), x);
/*      */   }
/*      */   
/*      */   public void updateBinaryStream(String columnLabel, InputStream x)
/*      */     throws SQLException
/*      */   {
/*  690 */     updateBinaryStream(findColumn(columnLabel), x);
/*      */   }
/*      */   
/*      */   public void updateCharacterStream(String columnLabel, Reader reader)
/*      */     throws SQLException
/*      */   {
/*  696 */     updateCharacterStream(findColumn(columnLabel), reader);
/*      */   }
/*      */   
/*      */   public void updateBlob(int columnIndex, InputStream inputStream)
/*      */     throws SQLException
/*      */   {
/*  702 */     updateObjectInner(columnIndex, inputStream);
/*      */   }
/*      */   
/*      */   public void updateBlob(String columnLabel, InputStream inputStream)
/*      */     throws SQLException
/*      */   {
/*  708 */     updateObjectInner(findColumn(columnLabel), inputStream);
/*      */   }
/*      */   
/*      */   public void updateClob(int columnIndex, Reader reader) throws SQLException
/*      */   {
/*  713 */     updateObjectInner(columnIndex, reader);
/*      */   }
/*      */   
/*      */   public void updateClob(String columnLabel, Reader reader)
/*      */     throws SQLException
/*      */   {
/*  719 */     updateClob(findColumn(columnLabel), reader);
/*      */   }
/*      */   
/*      */   public void updateNClob(int columnIndex, Reader reader) throws SQLException
/*      */   {
/*  724 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public void updateNClob(String columnLabel, Reader reader)
/*      */     throws SQLException
/*      */   {
/*  730 */     throw new UnsupportedOperationException();
/*      */   }
/*      */   
/*      */   public <T> T unwrap(Class<T> iface) throws SQLException
/*      */   {
/*  735 */     return (T)iface.cast(this);
/*      */   }
/*      */   
/*      */   public boolean isWrapperFor(Class<?> iface) throws SQLException
/*      */   {
/*  740 */     return iface.isInstance(this);
/*      */   }
/*      */   
/*      */   public String getString(int columnIndex) throws SQLException {
/*  744 */     Object obj = getObjectInner(columnIndex);
/*      */     
/*  746 */     if (obj == null) {
/*  747 */       return null;
/*      */     }
/*  749 */     if ((obj instanceof String)) {
/*  750 */       return (String)obj;
/*      */     }
/*  752 */     if ((obj instanceof Number)) {
/*  753 */       return obj.toString();
/*      */     }
/*  755 */     if ((obj instanceof byte[])) {
/*  756 */       return new String((byte[])obj);
/*      */     }
/*  758 */     if ((obj instanceof DmdbSerialBlob)) {
/*  759 */       DmdbSerialBlob blob = (DmdbSerialBlob)obj;
/*  760 */       byte[] bs = blob.getBytes(0L, (int)blob.length());
/*  761 */       return new String(bs);
/*      */     }
/*      */     
/*  764 */     if ((obj instanceof DmdbSerialClob)) {
/*  765 */       DmdbSerialClob clob = (DmdbSerialClob)obj;
/*  766 */       return clob.getSubString(0L, (int)clob.length());
/*      */     }
/*      */     
/*  769 */     return obj.toString();
/*      */   }
/*      */   
/*      */   public String getString(String columnName) throws SQLException {
/*  773 */     return getString(findColumn(columnName));
/*      */   }
/*      */   
/*      */   public byte getByte(int columnIndex) throws SQLException {
/*  777 */     Object obj = getObjectInner(columnIndex);
/*  778 */     if (obj == null) {
/*  779 */       return 0;
/*      */     }
/*  781 */     if ((obj instanceof Number)) {
/*  782 */       return ((Number)obj).byteValue();
/*      */     }
/*  784 */     if ((obj instanceof String)) {
/*  785 */       return ((String)obj).getBytes()[0];
/*      */     }
/*  787 */     if ((obj instanceof DmdbSerialBlob)) {
/*  788 */       DmdbSerialBlob blob = (DmdbSerialBlob)obj;
/*  789 */       byte[] bs = blob.getBytes(0L, (int)blob.length());
/*  790 */       return bs[0];
/*      */     }
/*      */     
/*  793 */     if ((obj instanceof DmdbSerialClob)) {
/*  794 */       DmdbSerialClob clob = (DmdbSerialClob)obj;
/*  795 */       return clob.getSubString(0L, (int)clob.length()).getBytes()[0];
/*      */     }
/*      */     
/*  798 */     throw new SQLException(Const.res.getString("error.dataConvertionError"));
/*      */   }
/*      */   
/*      */   public byte getByte(String columnName) throws SQLException {
/*  802 */     return getByte(findColumn(columnName));
/*      */   }
/*      */   
/*      */   public byte[] getBytes(int columnIndex) throws SQLException
/*      */   {
/*  807 */     Object obj = getObjectInner(columnIndex);
/*  808 */     if (obj == null) {
/*  809 */       return null;
/*      */     }
/*  811 */     if ((obj instanceof byte[])) {
/*  812 */       return (byte[])obj;
/*      */     }
/*  814 */     if ((obj instanceof String)) {
/*  815 */       return ((String)obj).getBytes();
/*      */     }
/*  817 */     if ((obj instanceof Number)) {
/*  818 */       return ((Number)obj).toString().getBytes();
/*      */     }
/*  820 */     if ((obj instanceof DmdbSerialBlob)) {
/*  821 */       DmdbSerialBlob blob = (DmdbSerialBlob)obj;
/*  822 */       byte[] bs = blob.getBytes(0L, (int)blob.length());
/*  823 */       return bs;
/*      */     }
/*      */     
/*  826 */     if ((obj instanceof DmdbSerialClob)) {
/*  827 */       DmdbSerialClob clob = (DmdbSerialClob)obj;
/*  828 */       return clob.getSubString(0L, (int)clob.length()).getBytes();
/*      */     }
/*      */     
/*  831 */     throw new SQLException(Const.res.getString("error.dataConvertionError"));
/*      */   }
/*      */   
/*      */   public byte[] getBytes(String columnName) throws SQLException
/*      */   {
/*  836 */     return getBytes(findColumn(columnName));
/*      */   }
/*      */   
/*      */   public ResultSetMetaData getMetaData() throws SQLException
/*      */   {
/*  841 */     return new DmdbResultSetMetaData(this.m_rsmd);
/*      */   }
/*      */   
/*      */   public Statement getStatement() throws SQLException
/*      */   {
/*  846 */     if (this.m_resultSet != null) {
/*  847 */       return this.m_resultSet.getStatement();
/*      */     }
/*  849 */     DBError.throwSQLException(
/*  850 */       Const.res.getString("error.cachedRowSetRsNotOpen"));
/*  851 */     return null;
/*      */   }
/*      */   
/*      */   public Connection getConnection() throws SQLException
/*      */   {
/*  856 */     getConnectionInner();
/*      */     
/*  858 */     return this.m_conn;
/*      */   }
/*      */   
/*      */   public void populate(ResultSet data) throws SQLException
/*      */   {
/*  863 */     this.m_resultSet = ((DmdbResultSet)data);
/*      */     
/*  865 */     super.populate(this.m_resultSet.getRealRs());
/*      */   }
/*      */   
/*      */   public void setMetaData(RowSetMetaData md) throws SQLException
/*      */   {
/*  870 */     if ((md instanceof DmdbRowSetMetaData)) {
/*  871 */       setMetaData(((DmdbResultSetMetaData)md).getRealRsmd());
/*      */     }
/*      */   }
/*      */   
/*      */   public ResultSet getOriginal() throws SQLException {
/*  876 */     DmdbCachedRowSet cachedrowset = new DmdbCachedRowSet();
/*  877 */     cachedrowset.m_rsmd = this.m_rsmd;
/*  878 */     cachedrowset.m_rowCount = this.m_rowCount;
/*  879 */     cachedrowset.m_columnCount = this.m_columnCount;
/*  880 */     cachedrowset.m_currentRow = 0;
/*  881 */     cachedrowset.setType(1004);
/*  882 */     cachedrowset.setConcurrency(1008);
/*  883 */     cachedrowset.setReader(null);
/*  884 */     cachedrowset.setWriter(null);
/*      */     
/*  886 */     DmdbRow row = null;
/*  887 */     for (int i = 0; i < this.m_rows.size(); i++) {
/*  888 */       row = new DmdbRow(this.m_columnCount, ((DmdbRow)this.m_rows.elementAt(i))
/*  889 */         .getOriginalRow());
/*  890 */       cachedrowset.m_rows.add(row);
/*      */     }
/*      */     
/*  893 */     return cachedrowset;
/*      */   }
/*      */   
/*      */   public ResultSet getOriginalRow() throws SQLException
/*      */   {
/*  898 */     DmdbCachedRowSet cachedrowset = new DmdbCachedRowSet();
/*  899 */     cachedrowset.m_rsmd = this.m_rsmd;
/*  900 */     cachedrowset.m_rowCount = 1;
/*  901 */     cachedrowset.m_columnCount = this.m_columnCount;
/*  902 */     cachedrowset.m_currentRow = 0;
/*  903 */     cachedrowset.setReader(null);
/*  904 */     cachedrowset.setWriter(null);
/*      */     
/*  906 */     DmdbRow row = new DmdbRow(this.m_rsmd.getColumnCount(), getCurrentRow()
/*  907 */       .getOriginalRow());
/*  908 */     cachedrowset.m_rows.add(row);
/*      */     
/*  910 */     return cachedrowset;
/*      */   }
/*      */   
/*      */   public RowSet createShared() throws SQLException
/*      */   {
/*  915 */     DmdbCachedRowSet rowset = new DmdbCachedRowSet();
/*  916 */     rowsetShared(rowset);
/*      */     
/*  918 */     return rowset;
/*      */   }
/*      */   
/*      */   public CachedRowSet createCopy() throws SQLException
/*      */   {
/*  923 */     DmdbCachedRowSet rowset = new DmdbCachedRowSet();
/*  924 */     rowsetCopy(rowset);
/*      */     
/*  926 */     return rowset;
/*      */   }
/*      */   
/*      */   public CachedRowSet createCopySchema() throws SQLException
/*      */   {
/*  931 */     DmdbCachedRowSet rowset = (DmdbCachedRowSet)createCopy();
/*      */     
/*  933 */     rowset.m_rows = null;
/*  934 */     rowset.m_currentRow = 0;
/*  935 */     rowset.m_rowCount = 0;
/*  936 */     rowset.m_currentPage = 0;
/*      */     
/*  938 */     return rowset;
/*      */   }
/*      */   
/*      */   public CachedRowSet createCopyNoConstraints() throws SQLException
/*      */   {
/*  943 */     DmdbCachedRowSet rowset = (DmdbCachedRowSet)createCopy();
/*      */     
/*  945 */     rowset.m_listeners = new Vector();
/*  946 */     rowset.unsetMatchColumn(rowset.getMatchColumnIndexes());
/*  947 */     rowset.unsetMatchColumn(rowset.getMatchColumnNames());
/*      */     
/*  949 */     return rowset;
/*      */   }
/*      */   
/*      */   public void rowSetPopulated(RowSetEvent event, int numRows)
/*      */     throws SQLException
/*      */   {
/*  955 */     if ((numRows < 0) || (numRows > this.m_rowCount)) {
/*  956 */       throw new SQLException(
/*  957 */         Const.res.getString("error.cachedRowSetRowParamInvalid"));
/*      */     }
/*  959 */     if (this.m_rowCount % numRows == 0) {
/*  960 */       event = new RowSetEvent(this);
/*  961 */       notifyRowSetChanged();
/*      */     }
/*      */   }
/*      */   
/*      */   public void populate(ResultSet rs, int startRow) throws SQLException
/*      */   {
/*  967 */     this.m_resultSet = ((DmdbResultSet)rs);
/*      */     
/*  969 */     super.populate(this.m_resultSet.getRealRs(), startRow);
/*      */   }
/*      */   
/*      */   public void execute(Connection conn) throws SQLException
/*      */   {
/*  974 */     checkConnSpecified(conn);
/*      */     
/*  976 */     this.m_conn = ((DmdbConnection)conn);
/*      */     
/*  978 */     super.execute(this.m_conn.getRealConn());
/*      */     
/*  980 */     if (this.m_resultSet_bs == null) {
/*  981 */       this.m_resultSet = null;
/*      */     } else {
/*  983 */       this.m_resultSet = new DmdbResultSet(this.m_resultSet_bs);
/*      */     }
/*      */   }
/*      */   
/*      */   public void acceptChanges(Connection conn) throws SyncProviderException {
/*      */     try {
/*  989 */       checkConnSpecified(conn);
/*      */     } catch (SQLException ex) {
/*  991 */       throw new SyncProviderException(ex.getMessage());
/*      */     }
/*      */     
/*  994 */     this.m_conn = ((DmdbConnection)conn);
/*      */     
/*  996 */     super.acceptChanges(this.m_conn.getRealConn());
/*      */   }
/*      */   
/*      */   public void execute() throws SQLException
/*      */   {
/* 1001 */     getConnection();
/*      */     
/* 1003 */     super.execute();
/*      */     
/* 1005 */     if (this.m_resultSet_bs == null) {
/* 1006 */       this.m_resultSet = null;
/*      */     } else {
/* 1008 */       this.m_resultSet = new DmdbResultSet(this.m_resultSet_bs);
/*      */     }
/*      */   }
/*      */   
/*      */   public void acceptChanges() throws SyncProviderException {
/*      */     try {
/* 1014 */       getConnection();
/*      */     } catch (SQLException ex) {
/* 1016 */       throw new SyncProviderException(ex.getMessage());
/*      */     }
/*      */     
/* 1019 */     super.acceptChanges();
/*      */   }
/*      */   
/*      */   public <T> T getObject(int columnIndex, Class<T> type)
/*      */     throws SQLException
/*      */   {
/* 1025 */     DBError.throwUnsupportedSQLException();
/* 1026 */     return null;
/*      */   }
/*      */   
/*      */   public <T> T getObject(String columnLabel, Class<T> type)
/*      */     throws SQLException
/*      */   {
/* 1032 */     DBError.throwUnsupportedSQLException();
/* 1033 */     return null;
/*      */   }
/*      */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\rowset\DmdbCachedRowSet.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */